package com.majun.base.mono;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public class ConversionExample {
	public static void main(String[] args) {
		// Mono转Flux
		Mono<String> mono = Mono.just("Hello, World");
		Flux<String> fluxFromMono = mono.flux();
		fluxFromMono.subscribe(System.out::println);

		// Flux转Mono
		Flux<Integer> flux = Flux.just(1, 2, 3, 4, 5);
		Mono<Integer> monoFromFlux = flux.next();
		monoFromFlux.subscribe(System.out::println);

	}
}
